﻿namespace WizardEngine.Core.Specification
{
    /// <summary>
    /// Specification of wizard steps connections to other ones.
    /// </summary>
    public interface IStepSpecification<T> : IStepBinder<T> where T : FlowState
    {
        /// <summary>
        /// Defines connection from this step to destination one by transtion with given condition. 
        /// </summary>
        /// <param name="destination">Target step. </param>
        /// <param name="condition">Transition condition. </param>
        /// <returns>Source step.</returns>
        IStepSpecification<T> ConnectTo(IStepSpecification<T> destination, TransitionCondition<T> condition);

        /// <summary>
        /// Marks the step as initial one if possible. 
        /// </summary>
        /// <returns>The step. </returns>
        /// <exception cref="CannotCreateMoreThanOneInitialStep" />
        IStepSpecification<T> MakeInitial();
    }
}